/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FrmPeminjamanView.java
 *
 * Created on 23 Sep 12, 11:31:07
 */
package sistemperpustakaan.view.transaksi;

import com.toedter.calendar.JDateChooser;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JRadioButton;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.event.InternalFrameEvent;
import javax.swing.event.InternalFrameListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import sistemperpustakaan.controller.TransaksiController;
import sistemperpustakaan.model.TransaksiModel;
import sistemperpustakaan.tablemodel.TransaksiTableModel;
import sistemperpustakaan.utility.DateUtility;
import sistemperpustakaan.utility.ReportUtility;
import sistemperpustakaan.view.FrmMain;

/**
 *
 * @author EKo
 */
public class FrmTransaksiView extends javax.swing.JInternalFrame implements InternalFrameListener, ListSelectionListener {

    FrmMain frameMain;
    TransaksiModel model;
    TransaksiController controller;
    TransaksiTableModel tableModel;
    DialogTransaksiDetail transaksiDetail;
    DateUtility du = new DateUtility();
    int idTransaksi = -1;
    int opt = 1;

    /** Creates new form FrmPeminjamanView */
    public FrmTransaksiView(FrmMain main) {
        this.frameMain = main;
        model = new TransaksiModel();
        controller = new TransaksiController(this, model);
        initComponents();

        addInternalFrameListener(this);
        tblTransaksi.getSelectionModel().addListSelectionListener(this);
        tblTransaksi.setModel(new TransaksiTableModel());
        setRadio();
        setTableWidth();

        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Date date = new Date();
        String ta = df.format(date);
        txtTanggalAwal.setDate(du.getBeginOfMonthDate());
        txtTanggalAkhir.setDate(du.getEndOfMonthDate());
//        System.out.println("Isi = " + du.getBeginOfMonthDate());
//        System.out.println("Isi = " + du.getEndOfMonthDate());
//        txtTanggalAwal.setDate(date);
//        txtTanggalAkhir.setDate(date);

        radioBelumSelesai.setSelected(true);
//        controller.findDataTransaksi();
        
    }

    public FrmMain getFrameMain() {
        return frameMain;
    }

    public void setFrameMain(FrmMain frameMain) {
        this.frameMain = frameMain;
    }

    public int getIdTransaksi() {
        return idTransaksi;
    }

    public void setIdTransaksi(int idTransaksi) {
        this.idTransaksi = idTransaksi;
    }

    public int getOpt() {
        return opt;
    }

    public void setOpt(int opt) {
        this.opt = opt;
    }

    public JRadioButton getRadioAll() {
        return radioAll;
    }

    public void setRadioAll(JRadioButton radioAll) {
        this.radioAll = radioAll;
    }

    public JRadioButton getRadioBelumSelesai() {
        return radioBelumSelesai;
    }

    public void setRadioBelumSelesai(JRadioButton radioBelumSelesai) {
        this.radioBelumSelesai = radioBelumSelesai;
    }

    public JRadioButton getRadioSelesai() {
        return radioSelesai;
    }

    public void setRadioSelesai(JRadioButton radioSelesai) {
        this.radioSelesai = radioSelesai;
    }

    public TransaksiTableModel getTableModel() {
        return tableModel;
    }

    public void setTableModel(TransaksiTableModel tableModel) {
        this.tableModel = tableModel;
    }

    public JTable getTblTransaksi() {
        return tblTransaksi;
    }

    public void setTblTransaksi(JTable tblTransaksi) {
        this.tblTransaksi = tblTransaksi;
    }

    public JTextField getTxtJudul() {
        return txtJudul;
    }

    public void setTxtJudul(JTextField txtJudul) {
        this.txtJudul = txtJudul;
    }

    public JTextField getTxtNama() {
        return txtNama;
    }

    public void setTxtNama(JTextField txtNama) {
        this.txtNama = txtNama;
    }

    public JTextField getTxtNis() {
        return txtNis;
    }

    public void setTxtNis(JTextField txtNis) {
        this.txtNis = txtNis;
    }

    public JTextField getTxtTransaksiId() {
        return txtTransaksiId;
    }

    public void setTxtTransaksiId(JTextField txtTransaksiId) {
        this.txtTransaksiId = txtTransaksiId;
    }

    public JDateChooser getTxtTanggalAkhir() {
        return txtTanggalAkhir;
    }

    public void setTxtTanggalAkhir(JDateChooser txtTanggalAkhir) {
        this.txtTanggalAkhir = txtTanggalAkhir;
    }

    public JDateChooser getTxtTanggalAwal() {
        return txtTanggalAwal;
    }

    public void setTxtTanggalAwal(JDateChooser txtTanggalAwal) {
        this.txtTanggalAwal = txtTanggalAwal;
    }

    public JLabel getLblJumlah() {
        return lblJumlah;
    }

    public void setLblJumlah(JLabel lblJumlah) {
        this.lblJumlah = lblJumlah;
    }

    public JLabel getLblDenda() {
        return lblDenda;
    }

    public void setLblDenda(JLabel lblDenda) {
        this.lblDenda = lblDenda;
    }


    public final void setRadio() {
        radioAll.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                opt = -1;
            }
        });
        radioSelesai.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                opt = 0;
            }
        });
        radioBelumSelesai.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                opt = 1;
            }
        });

    }

    public final void setTableWidth() {
        int[] width = {80, 80, 120, 150, 100, 80, 80, 320, 100, 100, 100, 100,100,100};
        for (int i = 0; i < 14; i++) {
            tblTransaksi.getColumnModel().getColumn(i).setPreferredWidth(width[i]);
        }
    }

    public final void setAction() {
        frameMain.getBtnCari().setActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (isSelected()) {
                    controller.findDataTransaksi();
                }
            }
        });
        frameMain.getBtnRefresh().setActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (isSelected()) {
                    controller.refreshListTransaksi();
                }
            }
        });
        frameMain.getBtnDetail().setActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (idTransaksi == -1) {
                    JOptionPane.showMessageDialog(rootPane, "Anda belum memilih data");
                } else {
                    transaksiDetail = new DialogTransaksiDetail(frameMain, true, controller, idTransaksi);
                    transaksiDetail.setVisible(true);
                }
            }
        });

        frameMain.getBtnTambah().setActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (isSelected()) {
                    transaksiDetail = new DialogTransaksiDetail(frameMain, true, controller);
                    transaksiDetail.setVisible(true);
                }
            }
        });
        frameMain.getBtnViewReport().setActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (isSelected() && tblTransaksi.getRowCount() > 0) {
                    controller.report(ReportUtility.SHOW);
                }
            }
        });


        frameMain.getBtnPrintReport().setActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (isSelected() && tblTransaksi.getRowCount() > 0) {
                    controller.report(ReportUtility.PRINT);
                }
            }
        });
    }
    public int cekOpt() {
        int opt;
        if (radioAll.isSelected()) {
            opt = -1;
        } else if (radioSelesai.isSelected()) {
            opt = 0;
        } else {
            opt = 1;
        }
        return opt;
    }
    public int cekNoTransaksi() {
        int noTransaksi;
        if (txtTransaksiId.getText().isEmpty()) {
            noTransaksi = -1;
        } else {
            noTransaksi = Integer.parseInt(txtTransaksiId.getText());
        }
        return noTransaksi;
    }
    public String cekTanggalAwal() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Date dAwal = new Date();
        dAwal = txtTanggalAwal.getDate();
        String awal = df.format(dAwal);
//        System.out.println(awal);
        return awal;
    }
    public String cekTanggalAkhir() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Date dAkhir = new Date();
        dAkhir = txtTanggalAkhir.getDate();
        String akhir = df.format(dAkhir);
//        System.out.println(awal);
        return akhir;
    }
    public String cekNis() {
        String nis;
        if (txtNis.getText().isEmpty()) {
            nis = "_";
        } else {
            nis = txtNis.getText().toString();
        }
        return nis;
    }
    public String cekNama() {
        String nama;
        if (txtNama.getText().isEmpty()) {
            nama = "_";
        } else {
            nama = txtNama.getText().toString();
        }
        return nama;
    }
    public String cekJudul() {
        String judul;
        if (txtJudul.getText().isEmpty()) {
            judul = "_";
        } else {
            judul = txtJudul.getText().toString();
        }
        return judul;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        groupOption = new javax.swing.ButtonGroup();
        gbr = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        txtTransaksiId = new javax.swing.JTextField();
        txtNis = new javax.swing.JTextField();
        txtNama = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        txtJudul = new javax.swing.JTextField();
        txtTanggalAwal = new com.toedter.calendar.JDateChooser();
        txtTanggalAkhir = new com.toedter.calendar.JDateChooser();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblTransaksi = new javax.swing.JTable();
        jPanel1 = new javax.swing.JPanel();
        radioAll = new javax.swing.JRadioButton();
        radioSelesai = new javax.swing.JRadioButton();
        radioBelumSelesai = new javax.swing.JRadioButton();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        lblJumlah = new javax.swing.JLabel();
        lblDenda = new javax.swing.JLabel();

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);
        setTitle("Daftar Transaksi");

        gbr.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        gbr.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sistemperpustakaan/image/transaksi.png"))); // NOI18N

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel11.setText("Data Transaksi Perpustakaan");

        jLabel1.setText("ID Transaksi");

        jLabel2.setText("Tgl Peminjaman");

        jLabel3.setText("NIS/NIP");

        jLabel4.setText("Nama");

        jLabel5.setText("Judul");

        txtTanggalAwal.setDateFormatString("dd MMMM yyyy");
        txtTanggalAwal.setMaxSelectableDate(new java.util.Date(253370743287000L));

        txtTanggalAkhir.setDateFormatString("dd MMMM yyyy");

        tblTransaksi.setAutoCreateRowSorter(true);
        tblTransaksi.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tblTransaksi.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        jScrollPane1.setViewportView(tblTransaksi);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Option"));

        groupOption.add(radioAll);
        radioAll.setText("All");

        groupOption.add(radioSelesai);
        radioSelesai.setText("Selesai");

        groupOption.add(radioBelumSelesai);
        radioBelumSelesai.setText("Belum Selesai");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(radioAll)
                    .addComponent(radioSelesai)
                    .addComponent(radioBelumSelesai))
                .addContainerGap(35, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(radioAll)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(radioSelesai)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(radioBelumSelesai))
        );

        jLabel6.setText("sampai");

        jLabel7.setText("item(s) found");

        lblJumlah.setFont(new java.awt.Font("Tahoma", 1, 18));
        lblJumlah.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lblJumlah.setText("0");

        lblDenda.setFont(new java.awt.Font("Tahoma", 1, 18));
        lblDenda.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lblDenda.setText("Total Denda Rp. 0,-");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2)))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtTransaksiId, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(txtTanggalAwal, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(jLabel6)
                        .addGap(10, 10, 10)
                        .addComponent(txtTanggalAkhir, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(txtNama, javax.swing.GroupLayout.PREFERRED_SIZE, 278, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(txtNis, javax.swing.GroupLayout.PREFERRED_SIZE, 278, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(txtJudul, javax.swing.GroupLayout.PREFERRED_SIZE, 278, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(18, 18, 18)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(lblJumlah, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel7)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addGap(12, 12, 12)
                        .addComponent(gbr))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(lblDenda, javax.swing.GroupLayout.DEFAULT_SIZE, 359, Short.MAX_VALUE)
                        .addContainerGap())))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 893, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(11, 11, 11)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jLabel1)
                        .addGap(15, 15, 15)
                        .addComponent(jLabel2))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addComponent(txtTransaksiId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(6, 6, 6)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtTanggalAwal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(6, 6, 6)
                                .addComponent(jLabel6))
                            .addComponent(txtTanggalAkhir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(11, 11, 11)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(txtNis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel3))
                                .addGap(13, 13, 13)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(txtNama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel4))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(txtJudul, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel5)))
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(12, 12, 12)
                                .addComponent(jLabel11))
                            .addComponent(gbr, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(22, 22, 22)
                        .addComponent(lblDenda)
                        .addGap(13, 13, 13)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblJumlah)
                            .addComponent(jLabel7))))
                .addGap(7, 7, 7)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel gbr;
    private javax.swing.ButtonGroup groupOption;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblDenda;
    private javax.swing.JLabel lblJumlah;
    private javax.swing.JRadioButton radioAll;
    private javax.swing.JRadioButton radioBelumSelesai;
    private javax.swing.JRadioButton radioSelesai;
    private javax.swing.JTable tblTransaksi;
    private javax.swing.JTextField txtJudul;
    private javax.swing.JTextField txtNama;
    private javax.swing.JTextField txtNis;
    private com.toedter.calendar.JDateChooser txtTanggalAkhir;
    private com.toedter.calendar.JDateChooser txtTanggalAwal;
    private javax.swing.JTextField txtTransaksiId;
    // End of variables declaration//GEN-END:variables

    public void internalFrameOpened(InternalFrameEvent e) {
    }

    public void internalFrameClosing(InternalFrameEvent e) {
    }

    public void internalFrameClosed(InternalFrameEvent e) {
        frameMain.getDesktopPane().selectFrame(true);
    }

    public void internalFrameIconified(InternalFrameEvent e) {
    }

    public void internalFrameDeiconified(InternalFrameEvent e) {
    }

    public void internalFrameActivated(InternalFrameEvent e) {
        setAction();
    }

    public void internalFrameDeactivated(InternalFrameEvent e) {
    }

    public void valueChanged(ListSelectionEvent e) {
        try {
            idTransaksi = Integer.valueOf(tblTransaksi.getValueAt(tblTransaksi.getSelectedRow(), 0).toString());
        } catch (Exception ex) {
        }
    }
}
